#include <bits/stdc++.h>
using namespace std;
int n, h[1000006], r[1000006], R[1000006];
double hans[1000006];
#define eps 1e-10

#define le(a, b) (a < b || fabs(a - b) < eps)

inline bool jiao(const  double &x11, const  double &y11, const  double &x12, const  double &y12, 
		const  double &x21, const  double &y21, const  double &x22, const  double &y22) {
	const double k1 = (y11 - y12) / (x11 - x12);
	const  double b1 = y11 - k1 * x11;
	const  double k2 = (y21 - y22) / (x21 - x22);
	const  double b2 = y21 - k2 * x21;
	const  double x = (b2 - b1) / (k1 - k2);
	const  double y = k1 * x + b1;
	return (le(min(x11, x12), x) && le(x,max(x11, x12)) && le(min(x21, x22), x) && le(x, max(x21, x22)) &&
			le(min(y11, y12), y) && le(y,max(y11, y12)) && le(min(y21, y22),y) && le(y, max(y21, y22)));
}

bool check(int &i, const double &mid, int lm = 1000000) {
	for (int j = max(i - lm, 1); j < i; ++j) {
		if (jiao(-r[i], mid, r[i], mid, -r[j], hans[j], -R[j], hans[j] + h[j]) ||
			jiao(-r[i], mid, -R[i], mid + h[i], -r[j], hans[j], -R[j], hans[j] + h[j]))
				return 0;
	}
	return 1;
}

int main() {
	freopen("wan.in", "r", stdin);
	freopen("wan.out", "w", stdout);
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cin >> n;
	if (n <= 3000) {
	double ans = 0, tmp = 0, upb = 0;
	for (int i = 1; i <= n; ++i) {
		cin >> h[i] >> r[i] >> R[i];
		if (i == 1) {
			hans[i] = 0;
		} else {
			double l = tmp, r = upb + eps;
			int rft = 0;
			while (fabsl(r - l) / max(l, (double)1) > eps) 
			{
				const double mid = (l + r) / (double)2.0;
				if (check(i, mid)) r = mid;
				else l = mid;
			}
			hans[i] = l;
		}
		upb += h[i];
		tmp = max(tmp, hans[i]);
		ans = max(ans, hans[i] + h[i]);
	}
	printf("%.15lf\n", ans);
	} else {
	double ans = 0, tmp = 0, upb = 0;
#undef eps
#define eps 1e-6
	for (int i = 1; i <= n; ++i) {
		cin >> h[i] >> r[i] >> R[i];
		if (i == 1) {
			hans[i] = 0;
		} else {
			double l = tmp, r = upb + eps;
			int rft = 0;
			while (fabsl(r - l) / max(l, (double)1.0)> eps) 
			{
				const double mid = (l + r) / (double)2.0;
				if (check(i, mid, 20)) r = mid;
				else l = mid;
			}
			for (int i = 1; i <= 7; ++i) {
				const double mid = (l + r) / (double)2.0;
				if (check(i, mid, 20)) r = mid;
				else l = mid;
			}

			hans[i] = r;
		}
		upb += h[i];
		tmp = max(tmp, hans[i]);
		ans = max(ans, hans[i] + h[i]);
	}
	printf("%.15Lf\n", (long double)ans * 1.079618902061542);
	}
	return 0;
}
